<template>
  <div>
      <el-tag size="small" style="width:100%">待诊</el-tag>
      <el-table
      size="small"
      :data="wait"
      :show-header="false"
      style="width: 100%"
      @row-click="handlerRowSelect"
      >
      <el-table-column
        prop="id"
        label="id"
        >
      </el-table-column>
      <el-table-column
        prop="name"
        label="姓名"
        >
      </el-table-column>
      <el-table-column
        prop="age"
        label="年龄">
      </el-table-column>
    </el-table>

    <el-tag size="small" style="width:100%">已诊</el-tag>
      <el-table
      size="small"
      :data="complish"
      :show-header="false"
      style="width: 100%"
      @row-click="handlerRowSelect"
      >
      <el-table-column
        prop="id"
        label="id"
        >
      </el-table-column>
      <el-table-column
        prop="name"
        label="姓名"
        >
      </el-table-column>
      <el-table-column
        prop="age"
        label="年龄">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
    name: 'RegistList',
    props:['type'],
    data(){
        return {
            tableData:[],
            wait:[],
            complish:[]
        }
    },
    methods:{
        getData()
        {
            this.axios.get('/doctor/regist-list',response => {
              const registers = response.obj
              for(let i in registers)
              {
                if(registers[i].status == 1)
                {
                  this.wait.push(registers[i])
                }
                else{
                  this.complish.push(registers[i])
                }
              }
            },{type: this.type})
        },
        handlerRowSelect(row, column, event){
          this.$emit('rowselect',row)
        }
    },
    created(){
        this.getData()
    }
}
</script>

<style>

</style>